package sgbag1;

import java.awt.Graphics;

import javax.swing.JFrame;

import sgbag1.Controlleur.FenetrePrincipale;
import sgbag1.Controlleur.FichierConfig;
import sgbag1.Controlleur.Simulation;

import sgbag1.Noyau.Aeroport;

import sgbag1.Noyau.Bagage;

import sgbag1.Vues.TestFrame;
import sgbag1.Vues.VueAeroport;
import java.awt.Graphics;

import sgbag1.Noyau.Chariot;

public class Main {
    /**
     * Create the GUI and show it.  For thread safety,
     * this method should be invoked from the
     * event-dispatching thread.
     */
    public static JFrame frame;
    private static void createAndShowGUI() {
        //Create and set up the window.
        frame = new FenetrePrincipale();
        //frame = new TestFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        
        //Display the window.
        frame.pack();
        frame.setVisible(true);
    }
 
    public static void main(String[] args) {
        //Schedule a job for the event-dispatching thread:
        //creating and showing this application's GUI.
        javax.swing.SwingUtilities.invokeLater(new Runnable() {
                    public void run() {
                        createAndShowGUI();
                    }
                });
        
        /*
        Aeroport a = new Aeroport();
        VueAeroport v = new VueAeroport(0, 0);
        
        FichierConfig ficConfig = new FichierConfig("config1.xml");
        
        ficConfig.parserXML();
        
        a = ficConfig.getAeroport();
        v = ficConfig.getVueAeroport();

        frame = new TestFrame();
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        frame.setVisible(true);
        ((TestFrame)frame).ajoutVue(v);
        */
        
        /*Simulation fenetreSim = new Simulation(a,v);
        
        fenetreSim.setVisible(true);*/
        
        
        // ############################## TEST DU NOYAU ######################
        
        /*Bagage b1 = new Bagage(a.getListeGuichets().get(0).getTapis(), a.getListeToboggans().get(0));
        a.nouveauBagage(b1);
        
        Bagage b2 = new Bagage(a.getListeGuichets().get(1).getTapis(), a.getListeToboggans().get(1));
        a.nouveauBagage(b2);
        
        Bagage b3 = new Bagage(a.getListeGuichets().get(1).getTapis(), a.getListeToboggans().get(3));
        a.nouveauBagage(b3);
        
        Bagage b4 = new Bagage(a.getListeGuichets().get(1).getTapis(), a.getListeToboggans().get(1));
        a.nouveauBagage(b4);
        
        Bagage b5 = new Bagage(a.getListeGuichets().get(0).getTapis(), a.getListeToboggans().get(1));
        a.nouveauBagage(b5);
        
        while(true) {
            a.avancer();
            v.Dessiner(frame.getGraphics());
            try {
                Thread.sleep(200);
            } catch (InterruptedException e) {
            }
        }*/
    }
}
